class Solution {
    public int add(int a, int b) {
        while (b != 0) {
            int carry = (a & b) << 1; //&两1为1 其他为0
            a = a ^ b;//两个位相同为0，相异为1
            b = carry;
        }
        return a;
    }
}